<template>
  <div class="BusinessHomepage">
    <HomeActive :img="$base.baseImg+data.logo" />
    <!-- 商户地址 -->
    <div class="BusinessHomepage_title">
      <h3>{{data.mName}}</h3>
      <p>电话：{{data.phone}}</p>
      <p>
        商家地址：{{data.address}}
      </p>
    </div>
    <!-- 按钮 -->
    <div class="BusinessHomepage_button">
      <van-row gutter="20">
        <van-col span="12" @click="$router.push(`/onLineproductIist/${data.mid}`)">
          <van-button type="primary" color="#D2A166" block round size="normal"
            >线上商品</van-button
          >
        </van-col>
        <van-col span="12" @click="$router.push(`/offlineproductIist/${data.mid}`)">
          <van-button type="primary" color="#D2A166" block round size="normal"
            >线下商品</van-button
          >
        </van-col>
      </van-row>
      <van-row gutter="20">
        <van-col span="12" @click="$router.push('/onlineOrder')">
          <van-button type="primary"  color="#D2A166" block round size="normal"
            >线上订单</van-button
          >
        </van-col>
        <van-col span="12" @click="$router.push('/offlineOrder')">
          <van-button type="primary" color="#D2A166" block round size="normal"
            >线下订单</van-button
          >
        </van-col>
      </van-row>
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Component, Prop } from "vue-property-decorator";
import HomeActive from "@/components/HomeActive.vue";
import { Col, Row, Button } from "vant";

Vue.use(Col);
Vue.use(Row);
Vue.use(Button);
@Component({
  components: {
    HomeActive,
  },
})
export default class BusinessHomepage extends Vue {
  private data = {};
  private mounted(): void {
     this.$common.getAuthToken(this.getProDetails);
  }
  // 获取商户详情
  private getProDetails(): void {
    this.$post(`getMerchant`, { mid: 0 }).then((res: any) => {
      if (res.code == 0) {
        this.data = res.data;
      }
    });
  }
}
</script>

<style lang="scss" scoped>
.BusinessHomepage {
  width: 100%;
  box-sizing: border-box;
  .BusinessHomepage_title {
    width: 100%;
    padding: 30px;
    box-sizing: border-box;
    h3 {
      font-size: 32px;
      font-weight: 400;
      color: #000000;
      line-height: 1.5;
    }
    p {
      font-size: 30px;
      font-weight: 300;
      color: #343434;
      line-height: 2;
    }
  }
  .BusinessHomepage_button {
    width: 100%;
    padding: 30px;
    box-sizing: border-box;
    margin-top: 150px;
    button {
      margin-bottom: 50px;
    }
  }
}
</style>
